import Mock from 'mockjs'
Mock.setup({
  timeout: '300-600'
})
let packageData = Mock.mock({
  'code': 1,
  'msg': '',
  'data': [{
    id: '2019001',
    name: '包月套餐',
    create_time: '2019-05-19 01:01:01',
    price: 10,
    pkg_len: 7,
    valid_time: ['2019-05-19 00:00:00', '2019-05-20 00:00:00'],
    reveal: '1',
    description: '描述'
  }]
})
Mock.mock(/\/api\/product/, 'get', packageData)

let packageAddRes = Mock.mock({
  'code': 0,
  'msg': '处理成功'
})
Mock.mock(/\/api\/product/, 'post', packageAddRes)

let packagEditRes = Mock.mock({
  'code': 0,
  'msg': '处理成功'
})
Mock.mock(/\/api\/product/, 'put', packagEditRes)

let packagDelRes = Mock.mock({
  'code': 0,
  'msg': '处理成功'
})
Mock.mock(/\/api\/product/, 'delete', packagDelRes)

let packagViewRes = Mock.mock({
  'code': 0,
  'msg': '处理成功',
  'data': [
    {
      'productId': 1,
      'productName': '包月套餐',
      'describe': '这是包月套餐',
      'price': 1,
      'duration': '1',
      'autoRenew': '0'
    },
    {
      'productId': 2,
      'productName': '连续包月套餐',
      'describe': '这是连续包月套餐',
      'price': 3,
      'duration': '6',
      'autoRenew': '1'
    }
  ]
})
Mock.mock(/\/api\/show\/product/, 'get', packagViewRes)

export default Mock
